<%@page import="javax.sound.midi.MidiDevice.Info"%>
<%@ page import="java.net.URLEncoder"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.Calendar"%>
<%@ page import="com.finple.DBConnection"%>
<%@ page import="com.finple.MeetingInfoVo"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="../scheduler/dhtmlxscheduler.js" type="text/javascript"></script>
<link rel="stylesheet" href="../scheduler/dhtmlxscheduler.css" type="text/css">
</head>
<body>
	<%
		request.setCharacterEncoding("UTF-8");

		String initiatorAlias, title, location, password, description, initiatorEmail;

		title = request.getParameter("title");
		location = request.getParameter("location");
		password = "1234";
		description = request.getParameter("description");
		initiatorAlias = request.getParameter("initiatorAlias");
		initiatorEmail = request.getParameter("initiatorEmail");
	%>
	<form class="form-container" action="/Finple/data/create_step3.jsp" method="post">
		<div class="form-contain" align="center">
			<div class="process">
				<ol class="inline">
					<li><a href="/Finple/data/create_step1.jsp"><span class="text-success">일정 정보 입력하기</span></a></li>
					<li>▶</li>
					<li><a href="/Finple/data/create_step2.jsp">시간 제안하기</a></li>
					<li>▶</li>
					<li><a href="#">설정하기</a></li>
					<li>▶</li>
					<li><a href="#">초대하기</a></li>
				</ol>
			</div>
			<div id="header">
				<div id="pageTitle">
					<h2 align="center">
						<font color="#8B5927">시간 제안하기</font>
					</h2>
				</div>
			</div>
			<div align="center">
				<h5>일정을 만들고자 하는 날짜를 드래그 혹은 더블클릭하세요.</h5>
			</div>
			
			<input type="hidden" name="date" id="date" /> 
			<input type="hidden" name="title" value="<%=title%>" /> 
			<input type="hidden" name="location" value="<%=location%>" /> 
			<input type="hidden" name="description" value="<%=description%>" /> 
			<input type="hidden" name="initiatorAlias" value="<%=initiatorAlias%>" /> 
			<input type="hidden" name="initiatorEmail" value="<%=initiatorEmail%>" /> 
			<input type="hidden" name="name" value="test" />
			
			<%@ page import="com.dhtmlx.planner.*,com.dhtmlx.planner.data.*"%>
			<%!
				Calendar cal = Calendar.getInstance();
	
				String getPlanner(HttpServletRequest request) throws Exception {
					DHXPlanner s = new DHXPlanner("/Finple/codebase/", DHXSkin.TERRACE);
					s.setWidth(600);
					s.setHeight(600);
			
					//오늘 날짜를 구한다.
					s.setInitialDate(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH));
					s.load("/Finple/data/events.jsp", DHXDataFormat.JSON);
					s.data.dataprocessor.setURL("/Finple/data/events.jsp");
			
					return s.render();
				} 
			%>
			<div class="planner" id="planner"><%=getPlanner(request)%></div>
			<div>
				<div class="submit-container">
					<button type="button" class="btn btn-success">Back</button>
					<button type="submit" class="btn btn-success" onclick="getdate()">Next step</button>
				</div>
			</div>
		</div>
	</form>
</body>
</html>